-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add settings migration, improve share dialog and minimize to background by default #4259
Conversation
The proper solution to this is still #3477, right? |
yes, but that's out of scope for this version |
could this be done for this as well #3178 (comment) this exactly the same solution i suggested. i would suggest reading from #3178 (comment) to have a better understanding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested updating from the dev apk to the other under many configurations and everything worked just fine. Thank you!
app/src/main/java/org/schabi/newpipe/settings/SettingMigrations.java
Outdated
Show resolved
Hide resolved
import org.schabi.newpipe.report.ErrorActivity.ErrorInfo; | ||
import org.schabi.newpipe.report.UserAction; | ||
|
||
public final class SettingMigrations { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not in this PR, but we may consider adding junit tests for migrations, using some kind of mocked shared preferences
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Completely agree with that.
I was told of an inconsistency with the minimize on app switch options.
If minimize is set to popup, a popup will start, but if set to background the app just closes. I think this should be fixed before releasing 0.20.0, it shouldn't be difficult, so I'll look into it tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder regarding the autoplay discussion yesterday: #4071 (comment)
Do you intend for this to be a temporary fix for
until #3477 is fixed or will this be a permanent change? I think it might be better off as a permanent change. Minimizing is a feature Newpipe has that makes it superior to Youtube. Better that we alert the user that such a feature exists and let them turn it off manually, than to hide it and risk that most users don't even realise it is there.
Should there be a toast the first 2-3 times this happens? A user who is new to Newpipe (New to the Pipe? 🤭) might get surprised or think it is a bug. Something like "Minimizing to background/popup. This can be changed in settings." If the user does change it in settings, this toast could be turned off immediately. Otherwise, after it has been shown twice or thrice. |
I would leave it until changed in settings... no need to hide it |
It would be very irritating to see the toast every time when you know you can change it in settings but you want to continue with the default setting. Having to change a setting, then change it back again to get rid of a toast is bad UX. |
@opusforlife2 |
1801552
to
f814806
Compare
Update APKs: apps.zip I only fixed #4259 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, the first-time check looks good now
f814806
to
7878371
Compare
Fixed a typo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please review lines 452 to 470 of RouterActivity.java, I think that piece of code can be deleted, as "show_info_key" is not a choice anymore.
returnList.add(new AdapterChoiceItem(getString(R.string.video_player_key), | ||
getString(R.string.video_player), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to achieve what was discussed in #4071, I'd just add a condition here that shows "R.string.show_info" if autoplay is off, but still uses "R.string.video_player_key" as the key in any case. At the end of the day both options open the same activity, even though the outcome is different, so I think users would expect "Show info" to be selected in the dialog if they had used the "Video player" choice before disabling autoplay, and viceversa.
I don't think you would need to do anything else in order to achieve what I described above, since VideoDetailFragment already handles autoplay by itself.
4e46fa8
to
a0c12e1
Compare
Can you clarify this a little bit? If I have autoplay set to off, and Preferred open action is set to Video player (after Show info is removed) then will opening links from other apps autoplay the video? |
@opusforlife2 I think commit messages are still the old ones, so don't look at them now ;-) |
I did not change anything regarding @Stypox's suggestion yet. Last pushs were just fixes to the migration process. In the first implementations, all migrations were run and not only the ones for newer pref versions. |
a0c12e1
to
c701d4f
Compare
New APKs with the changes quoted above: apks.zip Please test this, everything should work fine under many conditions:
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Stypox Your changes look good 👍
When sharing to 'after.apk', you first see a notification saying "Getting info - loading requested content", and only after it is loaded does the app open. This isn't mentioned in the changes above. Also, this delay might be perceived as a bug or Newpipe being slow by the user. Maybe a toast should be shown additionally?
Correct options do show up for videos, but what has changed for playlists or channels? Depending on the autoplay setting, the Always ask menu shows 'Show info' or 'Video player'. Shouldn't this also happen for the selection menu in settings? That menu always shows 'Video player', even if autoplay is off. Could be confusing or misleading for users. Both minimize and preferred open action settings migrations happen correctly, for upgrading as well as importing. 👍 |
That's always been there
Both show info and video player should always be shown for channels and playlist, since they actually do different things
No, since as I said above both info and player are shown for playlists and channels
Great :-D |
Doesn't happen for me in either 0.19.8 or the latest unified debug. Only in this apk. Release and debug first open, then load the video details. This apk first loads video details, then opens with them already showing.
Wow, before this I didn't even know it was possible to play a queue externally. :P My bad. I didn't select Always Ask before testing playlists and channels.
I'm not talking about the Always Ask menu. I'm talking about the Preferred open action menu with radio buttons. It doesn't have Show Info when Autoplay is off, but still shows Video Player. In any case, the radio buttons seem to be for the case of a single video link being opened from another app. I think we might need separate Preferred 'open' action settings for playlists and channels. Because the current setting isn't geared towards them. Playlists and channels being affected seems more like a byproduct of the setting. |
c701d4f
to
5940cc4
Compare
…umstances With the new application workflow and unified player, video detail page and video player are the same activity. So show only one of these options based on whether autoplay is enabled or not, and show both if using external player
5940cc4
to
3c4a4e5
Compare
Yes
Does this apk work as expected? I'm not providing before and after apks, since the only thing I did was restoring some things unrelated to migration app-debug.zip. |
Oh no. The package is named org.schabi.newpipe.debug.pr, which is also the name of the notification PR apk. It installed over that one. xD |
The Getting requested info notification is gone now, and the behaviour is as it was before. Is that what we want, though? I kind of liked the new behaviour. Didn't like the idea of a toast? Now 'Preferred open action' shows both Show Info and Video player. That's not what I meant. When I set Autoplay to Off, I should see only Show Info. When I set it to On or Wifi, I should see only Video player. At least, that's what I thought up when I originally wrote the comment in that issue. |
@opusforlife2 that menu for now also applies to channels and playlists, so both "show info" and "video player" should be there. In a future PR we could add separated settings, and at that point I'd agree with you. But for now both have to be kept. |
This PR has nothing to do with that notification, so that won't be changed here |
Okay. Then selecting either Show info or Video player would mean the same thing for a video link, opening the video details page, right? Whether or not the video autoplays would then depend on that setting? |
Where was it added? O.o |
@TobiGr do you agree with what I said above? If so, this is ready ;-) @opusforlife2 the notification already exists when tapping video player or download, while show info is handled differently by opening the app directly. The change of behavior in the PR was just caused by a check being removed, which made it so that show info was the same as the others. |
Yes, it would mean the same thing. I realised this myself the other day, but since this part of code (i.e. |
What is it?
Description of the changes in your PR
The difference between "detail page" and the video player is only the phone's orientation. Therefore, we decided to remove the open "Detail Page" option from the share menu. To handle entries from older versions, I added a migration system for the settings / shared preferences which is quite similar to the one used in for the DB.
With the new app workflow introduced by the unified player PR, it is possible to minimize the video player to the bottom while doing other stuff in the app. However, this does only apply to the main fragment. When a user opens the settings or the about screen, the player stops. That's bad UX. For this reason, I set the "Minimize on app switch" setting to "background" instead of "None" to allow seamless transitions within the app as well as when closing NewPipe.
Fixes the following issue(s)
Closes #4070
Testing apk
note: I did not have much time for testing.
Please install the current dev version from the zip first and change the "Minimize on app switch" setting or keep it as it is to see if the migration works when updating with the other APK.
apps.zip
Agreement